﻿<script src ="/ticket/scripts/holiBusDetail.js?v=1.4"></script>
<script src ="scripts/httpService.js"></script>

<div class="pageheader">
    <h2><i class="fa fa-hand-o-up"></i> 假期班车管理 <span>订票情况查看</span></h2>
</div>

<div class="contentpanel" ng-app="holiBusDetailApp" ng-controller="holiBusDetailCtrl">
    <div class="row xg-content xg_holi_ticket">
        <div class="col-xs-12">
            <div class="row">
                <div class="xg-search float-fix">
                    <div class="input-group">
                        <div class="input-group-addon">未过期车次</div>
                        <select class="form-control" ng-options="(busOrder.departuredate+'--'+busOrder.orientation) group by busOrder.orientation for busOrder in validateBusOrders" ng-model="selectedBusOrder" ng-change="getBuses(selectedBusOrder)">
                            
                        </select>
                    </div>
                    <div class="input-group">
                        <div class="input-group-addon">已过期车次</div>
                        <select class="form-control" ng-options="(busOrder.departuredate+'--'+busOrder.orientation) group by busOrder.orientation for busOrder in invalidateBusOrders" ng-model="selectedBusOrder" ng-change="getBuses(selectedBusOrder)">                            
                        </select>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-12">
                    <div class="xg-overview">
                        <p> 车辆总数：<span>{{busOrder.busescount}}</span>；车座总数：<span>{{busOrder.seatscount}}</span>；已定座位：<span>{{busOrder.occupation}};</span>  车辆自增截至日期：<span>{{busOrder.endbusdate}}</span></p>
                    </div>
                </div>
            </div>
            <div class="row">
                <div class="col-xs-3 xg_table_nav">
                    <ul>
                        <li ng-class="{'active':busindex==$index}" ng-repeat="bus in buses" ng-click="busSelected($index,bus)">
                            <p>{{bus.number}}</span>号车：<span class="bus-route">{{bus.routeName}}</p>
                            <p>时间：{{bus.departuredate}}</p>
                            <p>订座情况：{{bus.occupation}}/{{bus.seatcount}}</p>
                        </li>
                       
                    </ul>
                </div>
                <div class="col-xs-9">
                    <div class="xg-seats-container float-fix">
                        <table>
                            <tr>
                                <td class="xg-seats-head">{{bus.number}} 号车</td>
                            </tr>                           
                            <tr ng-repeat="s in seats" class="seat-btn">
                            <td><button class="button " ng-click="ticketSeat(s.num1)" ng-disabled="s.name1!=''"  ng-class="{'seats-unavailable':s.name1!='' && s.type1 == 0,'seats-unavailable1':s.name1!='' && s.type1 == 1,'seats-unavailable2':s.name1!='' && s.type1 == 2,'seats-available':s.name1==''}">{{s.num1}}<span class="seats-name">{{s.name1}}</span></button></td>
                            <td ng-if="s.num2!=undefined"><button class="button" ng-click="ticketSeat(s.num2)" ng-disabled="s.name2!=''" ng-class="{'seats-unavailable':s.name2!='' && s.type2 == 0,'seats-unavailable1':s.name2!='' && s.type2 == 1,'seats-unavailable2':s.name2!='' && s.type2 == 2,'seats-available':s.name2==''}">{{s.num2}}<span class="seats-name">{{s.name2}}</span></button></td>
                            <td class="xg-seats-road"></td>
                            <td ng-if="s.num3!=undefined"><button class="button" ng-click="ticketSeat(s.num3)" ng-disabled="s.name3!=''"  ng-class="{'seats-unavailable':s.name3!='' && s.type3 == 0,'seats-unavailable1':s.name3!='' && s.type3 == 1,'seats-unavailable2':s.name3!='' && s.type3 == 2,'seats-available':s.name3==''}">{{s.num3}}<span class="seats-name">{{s.name3}}</span></button></td>
                            <td ng-if="s.num4!=undefined"><button class="button" ng-click="ticketSeat(s.num4)" ng-disabled="s.name4!=''"  ng-class="{'seats-unavailable':s.name4!='' && s.type4 == 0,'seats-unavailable1':s.name4!='' && s.type4 == 1,'seats-unavailable2':s.name4!='' && s.type4 == 2,'seats-available':s.name4==''}">{{s.num4}}<span class="seats-name">{{s.name4}}</span></button></td>
                        </tr>
                     
                           
                        </table>
                    </div><!-- /.xg-seats -->
                </div>
            </div>
        </div>
    </div><!-- /.xg-content -->


<!-- 模态框内容，未预定车票 -->
    <script type="text/ng-template" id="ticketSeatModel">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true" ng-click="close()">&times;</span></button>
                <h4 class="modal-title" >车票信息确认</h4>
            </div>
            <div class="modal-body">
                <div>
                    <p>你预定的车票信息如下：</p>
                    <p>时间：{{bus.departuredate}}</p>
                    <p>路线：{{bus.routeName}}</p>
                    <p>位置：{{bus.number}}号车，第{{seatedNum}}位</p>
                    <p>乘坐人：</p>
                    <div class="row">
                    <div class="col-md-5">
                    <input class="form-control" ng-model="seatName"></input>
                    </div>
                     <div class="col-md-7">
                    
                    </div>
                    </div>
                </div>
                
            <div class="alert alert-info" ng-show="loading || submitted">
            <span  ng-show='loading' > <i class="fa fa-spinner"></i></span>
            <span ng-show='submitted'>{{result}}</span>
            </div>
        
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" ng-click="close()">取消</button>
                <button type="button" class="btn btn-primary" ng-click="submit()">预定</button>
            </div>   
        </div>
</script>
</div><!-- contentpanel -->
<!--<script src="js/jquery-1.11.1.min.js"></script>-->
<!--<script src="js/jquery-migrate-1.2.1.min.js"></script>-->
<!--<script src="js/bootstrap.min.js"></script>-->
<!--<script src="js/modernizr.min.js"></script>-->
<!--<script src="js/jquery.sparkline.min.js"></script>-->
<!--<script src="js/toggles.min.js"></script>-->
<!--<script src="js/retina.min.js"></script>-->
<!--<script src="js/jquery.cookies.js"></script>-->
<script src="js/xg_js.js"></script>
<!--<script src="js/custom.js"></script>-->
<script>
    createMenu(3);
</script>


